package com.hsy.sunflowerbao.common.store

import com.flux.action.RxAction
import com.flux.action.RxStoreChange
import com.flux.dispatcher.Dispatcher
import com.hsy.sunflowerbao.base.action.ActionType
import com.hsy.sunflowerbao.base.store.BaseStore

/**
 * 主页面数据缓存
 * Created on 2018/3/26.
 *
 * @author Yang
 */
class MainStore(dispatcher: Dispatcher) : BaseStore(dispatcher) {

    override fun onRxAction(action: RxAction) {
        if (handleSuper) super.onRxAction(action)
        when (action.type) {
            else -> return
        }
        //数据变更，发出对应的Action，通知view刷新
        postChange(RxStoreChange(tag, action.type, action.success))
    }
}